package com.edu.zut.controller;


import com.edu.zut.result.ResponseResult;
import com.edu.zut.service.CollegeService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 学院表 前端控制器
 * </p>
 *
 * @author 许文科
 * @since 2023-01-12
 */
@RestController
@RequestMapping("/api/college")
public class CollegeController {

    @Resource
    private CollegeService collegeService;

    @GetMapping("/list")
    @PreAuthorize("hasAnyRole('admin','teacher','student')")
    public ResponseResult list() {
        return collegeService.AllCollege();
    }

}
